package com.da.javatest.niuke.jianzhi;

/**
 * @author chenlida
 * @date 2020/10/26 11:08
 * https://www.nowcoder.com/practice/59ac416b4b944300b617d4f7f111b215?
 * tpId=13&tags=&title=&diffculty=0&judgeStatus=0&rp=1
 */
public class C48Solution {
    public static int Add(int num1, int num2) {
        while (num2 != 0) {
            int temp = num1 ^ num2;
            num2 = (num1 & num2) << 1;
            num1 = temp;
        }
        return num1;
    }

    public static void main(String[] args) {
        System.out.println(Add(4, 5));
    }

}
